# rosette_barrel.py

from __future__ import division

from ot_simulator.component import component

class rosette_barrel(component.component):
    '''This needs to sit in front of the :class:`headstock` component.
    
    ===============  ==========================
     Input setting   
    ===============  ==========================
    rocking_offset   defaults to 0
    pumping_offset   defaults to 0
    ===============  ==========================

    ===============  ==========================
    Output setting
    ===============  ==========================
    <none>
    ===============  ==========================
    '''
    input_parameters = ('rocking_offset', 'pumping_offset')

    def get_transform(self, params, transform_in):
        rocking_offset = self.get_param(params, 'rocking_offset', 0.0)
        pumping_offset = self.get_param(params, 'pumping_offset', 0.0)
        transform_out = transform_in.move(x=rocking_offset, z=pumping_offset)
        return transform_out


def test():
    import doctest
    import sys
    sys.exit(doctest.testmod()[0])

if __name__ == "__main__":
    test()
